ci: open an issue if a scheduled workflow fails#2627
Open
tonyandrewmeyer wants to merge 4 commits into
Open
Conversation
Adds an open-issue-on-failure-if-scheduled job to each in-scope scheduled workflow so failures during a cron-triggered run produce a tracking issue, rather than relying on email to whoever last edited the schedule (per canonical#2424). Covers: integration, smoke, example-charm-integration-tests, example-charm-charmcraft-test, tiobe, update-best-practice-doc, update-charm-tests. Skipped: published-charms-tests (regularly fails, per the issue description noting it should be handled separately). Fixes canonical#2424
The seven callers now delegate to `.github/workflows/notify-scheduled-failure.yml` via `uses:`. Each caller keeps its `if:` gate, `needs:`, and `permissions:`; the shared `steps` block moves into the reusable workflow. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All other workflows in this repo use the `.yaml` extension. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
d88de54 to
4465ee9
Compare
james-garner-canonical
approved these changes
Jul 6, 2026
james-garner-canonical
left a comment
Contributor
There was a problem hiding this comment.
Thanks for doing this, it'll be interesting to see how this works out with a lot more separate workflows.
|
|
||
| open-issue-on-failure-if-scheduled: | ||
| if: ${{ failure() && github.event_name == 'schedule' }} | ||
| needs: [collect-spread-jobs, integration] |
Contributor
There was a problem hiding this comment.
Suggested change
| needs: [collect-spread-jobs, integration] | |
| needs: [integration] |
|
|
||
| open-issue-on-failure-if-scheduled: | ||
| if: ${{ failure() && github.event_name == 'schedule' }} | ||
| needs: [collect, integration] |
Contributor
There was a problem hiding this comment.
Suggested change
| needs: [collect, integration] | |
| needs: [integration] |
| - name: Create issue on failure | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| WORKFLOW_NAME: ${{ github.workflow }} |
Contributor
There was a problem hiding this comment.
Suggested change
| WORKFLOW_NAME: ${{ github.workflow }} | |
| WORKFLOW_NAME: ${{ github.workflow }} # The workflow that called this one. |
tromai
approved these changes
Jul 6, 2026
tromai
left a comment
Contributor
There was a problem hiding this comment.
Everything looks good to me. Thank you.
I agree with James on adding a small comment to WORKFLOW_NAME: ${{ github.workflow }}.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For each of our workflows that runs on a schedule, if the scheduled run fails, open an issue. This ensures everyone is aware and that there is tracking in GitHub, rather than just an email to the person that most recently set the schedule.
This uses the approach from Jubilant, where it's a new issue every time, rather than updating an existing one. The title and body are quite bare-boned, like Jubilant, but we could adjust that as needed. In practice, I think what we need is the discipline to promptly investigate opened issues (which were not doing a great job of in Jubilant) and convert them into detailed reports of the specific failure, and then close as duplicates new ones if needed. Alternatively, we could throw in some AI to investigate them and convert them into a detailed investigation.
I haven't tested this, but it's very strongly based on the Jubilant one, which has had several executions already. Testing would need to be done on my fork, but I can if desired.
Refs #2424